package com.chat.datea.bean.local_music;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by dllo on 15/10/23.
 */
public class LocalMusicEntity implements Parcelable{
    private long id;
    private long album_id;
    private String title;
    private String artist;
    private long duration;
    private long size;
    private String url;
    private String album;
    private int isMusic;
    private boolean isFavorite = false;

    public LocalMusicEntity() {
    }

    public LocalMusicEntity(long id, long album_id, String title, String artist, long duration, long size, String url, String album, int isMusic, boolean isFavorite) {
        this.id = id;
        this.album_id = album_id;
        this.title = title;
        this.artist = artist;
        this.duration = duration;
        this.size = size;
        this.url = url;
        this.album = album;
        this.isMusic = isMusic;
        this.isFavorite = isFavorite;
    }

    protected LocalMusicEntity(Parcel in) {
        id = in.readLong();
        album_id = in.readLong();
        title = in.readString();
        artist = in.readString();
        duration = in.readLong();
        size = in.readLong();
        url = in.readString();
        album = in.readString();
        isMusic = in.readInt();
        isFavorite = in.readByte() != 0;
    }

    public static final Creator<LocalMusicEntity> CREATOR = new Creator<LocalMusicEntity>() {
        @Override
        public LocalMusicEntity createFromParcel(Parcel in) {
            return new LocalMusicEntity(in);
        }

        @Override
        public LocalMusicEntity[] newArray(int size) {
            return new LocalMusicEntity[size];
        }
    };

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getAlbum_id() {
        return album_id;
    }

    public void setAlbum_id(long album_id) {
        this.album_id = album_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAlbum() {
        return album;
    }

    public void setAlbum(String album) {
        this.album = album;
    }

    public int getIsMusic() {
        return isMusic;
    }

    public void setIsMusic(int isMusic) {
        this.isMusic = isMusic;
    }

    public boolean isFavorite() {
        return isFavorite;
    }

    public void setIsFavorite(boolean isFavorite) {
        this.isFavorite = isFavorite;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeLong(album_id);
        dest.writeString(title);
        dest.writeString(artist);
        dest.writeLong(duration);
        dest.writeLong(size);
        dest.writeString(url);
        dest.writeString(album);
        dest.writeInt(isMusic);
        dest.writeByte((byte) (isFavorite ? 1 : 0));
    }
}
